package org.opengauss.sqltranslator.translatorenum;

public enum MysqlToPgSqlSysTableEnum {
    INFORMATION_SCHEMA_VIEWS_FROM("information_schema.VIEWS","pg_views"),
    INFORMATION_SCHEMA_COLUMNS_FROM("information_schema.COLUMNS","information_schema.COLUMNS");


    private String mysqlFrom;
    private String pgsqlFrom;

    MysqlToPgSqlSysTableEnum() {
    }

    MysqlToPgSqlSysTableEnum(String mysqlfrom, String pgsqlfrom) {
        this.mysqlFrom = mysqlfrom;
        this.pgsqlFrom = pgsqlfrom;
    }

    public String getMysqlFrom() {
        return mysqlFrom;
    }

    public void setMysqlFrom(String mysqlFrom) {
        this.mysqlFrom = mysqlFrom;
    }

    public String getPgsqlFrom() {
        return pgsqlFrom;
    }

    public void setPgsqlFrom(String pgsqlFrom) {
        this.pgsqlFrom = pgsqlFrom;
    }

    public static MysqlToPgSqlSysTableEnum getByMysqlFrom(String  mysqlFrom) {
        for (MysqlToPgSqlSysTableEnum sysTableEnum : MysqlToPgSqlSysTableEnum.values()) {
            if (sysTableEnum.mysqlFrom.equals(mysqlFrom)) {
                return sysTableEnum;
            }
        }
        return null;
    }
}
